// function PaginationHelper(collection, itemsPerPage){
//   this.collection = collection;
//   this.itemsPerPage = itemsPerPage;
// }

// // returns the number of items within the entire collection
// PaginationHelper.prototype.itemCount = function() {
//   return this.collection.length;
// }

// // returns the number of pages
// PaginationHelper.prototype.pageCount = function() {
//   return Math.ceil(this.collection.length / this.itemsPerPage);
// }

// // returns the number of items on the current page. page_index is zero based.
// // this method should return -1 for pageIndex values that are out of range
// PaginationHelper.prototype.pageItemCount = function(pageIndex) {
// //   console.log(pageIndex,this.collection,this.itemsPerPages)
//   if(pageIndex > (this.pageCount()-1)){return -1;}
//   else if(pageIndex == this.pageCount() -1){return this.collection.length % this.itemsPerPage;}
//   else{return this.itemsPerPage}
// }

// // determines what page an item is on. Zero based indexes
// // this method should return -1 for itemIndex values that are out of range
// PaginationHelper.prototype.pageIndex = function(itemIndex) {
//   if(!this.collection.length){return -1;}
//   else if(itemIndex > this.collection.length || itemIndex < 0){return -1;}
//   else{return Math.floor(itemIndex/this.itemsPerPage);}
// }
// var fruits = ["Banana", "Orange", "Apple", "Mango"];
// fruits.splice(2, 2); 
// console.log(fruits);
// fruits.splice(0, 1, "Watermelon", "Grape");
// console.log(fruits);
function bar(){
    return foo;
    foo=10;
    function foo(){
        var foo='11';
    }
}
console.log(typeof bar());

function bar1(){
    function foo(){}
    var foo;
    return foo;
    foo = 10;
    var foo='11';
}
console.log(typeof bar())